﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace SchemaMonitor.json
{
    [DataContract]
    public class CNodeReference
    {
        //Data
        [DataMember(Order = 1)] public Guid Guid   { get; set; }

        //Constructor
        public CNodeReference(Guid id)
        {
            this.Guid = id;
        }
        public CNodeReference(Guid id, CNode node) : this(id)
        {
            _node = node;
        }

        //public CNode Retrieve
        private CNode _node;
        public CNode Node
        {
            get
            {
                if (null == _node)
                    _node = new CNode(this.Guid);
                return _node;
            }
        }
    }
}
